package com.netnovelstore.pojo;

import com.alibaba.fastjson2.JSON;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@ApiModel(description = "书籍实体")
public class Book implements Serializable {
    @NotNull(message = "bookNumber不能为空")
    @ApiModelProperty(name = "bookNumber", value = "书籍编号", dataType = "Integer")
    private Integer bookNumber;
    @ApiModelProperty(name = "bookName", value = "书籍名称", dataType = "String")
    private String bookName;
    @ApiModelProperty(name = "bookImg", value = "书籍封面图片路径", dataType = "String")
    private String bookImg;
    @ApiModelProperty(name = "bookAuthor", value = "作者名", dataType = "String")
    private String bookAuthor;
    @ApiModelProperty(name = "bookStart", value = "书籍观看锚点", dataType = "Integer")
    private Integer bookStart;
    @ApiModelProperty(name = "bookIntroduce", value = "书籍简介", dataType = "String")
    private String bookIntroduce;
    @ApiModelProperty(name = "bookTotal", value = "书籍总字数", dataType = "Integer")
    private Double bookTotal;
    @ApiModelProperty(name = "type", value = "书籍类型", dataType = "String")
    private String type;
    @ApiModelProperty(name = "time", value = "书籍添加时间", dataType = "String")
    private String time;
    @ApiModelProperty(name = "free", value = "是否[免费]", dataType = "Integer")
    private Boolean free;
    @ApiModelProperty(name = "full", value = "是否[完结]", dataType = "Integer")
    private Boolean full;
    @ApiModelProperty(name = "quantity", value = "浏览人数", dataType = "Integer")
    private Integer quantity;
    @ApiModelProperty(name = "bookPath", value = "txt文件路径", dataType = "String")
    @NotNull(message = "bookPath不能为空")
    private String bookPath;

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
